//
//  EAHeightAndWeightAnalyzeController.m
//  WhatToEat
//
//  Created by 方力 on 15/10/29.
//  Copyright © 2015年 Mac. All rights reserved.
//

#import "EAHeightAndWeightAnalyzeController.h"


#define kWeightUrl @"http://www.syinchung.com/david/eatanalysis"
#define kHeightURL @"http://www.syinchung.com/david/analysis"
@interface EAHeightAndWeightAnalyzeController ()
@property(nonatomic,strong)UIWebView * webView;
@end

@implementation EAHeightAndWeightAnalyzeController

- (void)viewDidLoad {
    [super viewDidLoad];
 
    
    
    
    
    self.view.backgroundColor=kWhiteColor;
    self.navigationController.navigationBar.hidden=NO;
    
    self.webView=[[UIWebView alloc] initWithFrame:self.view.bounds];
    
    self.webView.scalesPageToFit=YES;
    
    [self.view addSubview:self.webView];
    

    self.webView.height=kUI_SCREEN_HEIGHT-64;

    
    
    
}


-(void)viewWillAppear:(BOOL)animated
{

    [super viewWillAppear:animated];
    
    
    
    if ([self.type isEqualToString:@"weight"]) {
        
        self.navigationItem.title=@"饮食分析";
        
        NSURL *url=[NSURL URLWithString:kWeightUrl];
        
        NSURLRequest *request=[NSURLRequest requestWithURL:url];
        
        [self.webView loadRequest:request];
    }
    
    
    if ([self.type isEqualToString:@"heigt"]) {
        
        self.navigationItem.title=@"身高分析";
        NSURL *url=[NSURL URLWithString:kHeightURL];
        
        NSURLRequest *request=[NSURLRequest requestWithURL:url];
        
        [self.webView loadRequest:request];
    }


    
    NSLog(@"-------%@",self.webView.scrollView);
    
}

@end
